package com.aitaoxue.palx.bean;

public class SortModel implements Comparable<SortModel> {
	private String name;
	private String sortLetters;

	public SortModel() {
	}

	public SortModel(String name, String sortLetters) {
		this.name = name;
		this.sortLetters = sortLetters;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSortLetters() {
		return sortLetters;
	}

	public void setSortLetters(String sortLetters) {
		this.sortLetters = sortLetters;
	}

	@Override
	public int compareTo(SortModel other) {
		if (this.getSortLetters().equals("@")) {
			return -1;
		} else if (this.getSortLetters().equals("!")) {
			if (other.getSortLetters().equals("@")) {
				return 1;
			} else {
				return -1;
			}
		} else if (this.getSortLetters().equals("#")) {
			return 1;
		} else {
			if (other.getSortLetters().equals("!")
					|| other.getSortLetters().equals("@")) {
				return 1;
			}else if(other.getSortLetters().equals("#")){
				return -1;
			}else{
				return this.getSortLetters().compareTo(other.getSortLetters());
			}
		}
	}

}
